package com.pingtai.xinlang.login.persistent;

import java.io.IOException;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.client.HttpClient;
import org.apache.http.cookie.Cookie;
import org.apache.http.impl.client.AbstractHttpClient;
import org.json.JSONException;
import com.pingtai.xinlang.login.login.FeedUtils;
import com.pingtai.xinlang.login.model.WeiboMsg;

public class PersistentWeiboMsg {
	private static final Log logger = LogFactory.getLog(PersistentWeiboMsg.class);
//	public static void main(String[] args) throws JSONException, IOException {
//		FeedUtils utils = new FeedUtils();
////		HttpClient client = WeiboLoginService.getLoginStatus();
//        String personalUrl = "http://weibo.com/3464122142/fans";
////        List<Cookie> cookies = ((AbstractHttpClient) client).getCookieStore().getCookies();    
//        for (int i = 0; i < cookies.size(); i++) {  
//            System.out.println("- " + cookies.get(i).toString());  
//        }    
//
//        List<WeiboMsg> homeMsgs = utils.getHomeWeiboMsgs(client, personalUrl);
//         //将每次爬取到的url读加入数据库，下次从数据库取出url，结合bloomfilter来判断是否爬取过，
//        //如果重启后，则要将爬取过的url来初始化bloomfilter
//        
//        
//         //接下来从上面获取的信息里进行爬取
//        //for()遍历
//        String url = "http://weibo.com/sojava";
//        List<WeiboMsg> msgs = utils.getPersonalPageWeibo(client, url, "2046055133");
//        logger.info("personal size" + msgs.size());
//	}
}
